{ Summer Informatics School.
  Problemset: http://agul-problems1.googlecode.com/svn/trunk/2010-2011/sis/problemset11.pdf
  Problem H
  Points: 100
}
var i,j,n,m,k,cur,t:longint; a:array[0..60,0..60] of longint;
begin
read(n,m);
fillchar(a,sizeof(a),0);
k:=n*m;
t:=1;
i:=1;
j:=1;
for cur:=1 to k do begin
  a[i][j]:=cur;
  if t=1 then inc(j) else
  if t=2 then inc(i) else
  if t=3 then dec(j) else dec(i);
  if (j>n) or (i>m) or (a[i][j]<>0) or (i=0) or (j=0) then begin
    if t=1 then begin
      dec(j);
      inc(i);
    end else
    if t=2 then begin
      dec(i);
      dec(j);
    end else
    if t=3 then begin
      inc(j);
      dec(i);
    end else begin
      inc(i);
      inc(j);
    end;
    t:=t mod 4+1;
  end;
end;
for i:=1 to m do begin
  for j:=1 to n do write(a[i][j],' ');
  writeln;
end;
end.
